﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;

namespace MethodWorx.CMS.Linq
{
    [Table(Name="dbo.GenericStorageIndex")]
    public class LinqGenericStorageIndex
    {
        private EntityRef<LinqGenericStorage> storage = new EntityRef<LinqGenericStorage>();

        [Column(IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]
        public Guid Id { get; set; }
        [Column(UpdateCheck = UpdateCheck.Never)]
        public Guid GenericStorageId { get; set; }
        [Column(UpdateCheck=UpdateCheck.Never)]
        public string Type { get; set; }
        [Column(UpdateCheck = UpdateCheck.Never)]
        public string Name { get; set; }
        [Column(UpdateCheck = UpdateCheck.Never)]
        public string Value { get; set; }

        [Association(Name="Storage", IsForeignKey=true, OtherKey="Id", ThisKey="GenericStorageId", Storage="storage")]
        public LinqGenericStorage Storage
        {
            get { return this.storage.Entity; }
            set { this.storage.Entity = value; }
        }
    }
}
